var BusCon = require("../../core/bus/_con");
var db = require("../../core/db/index");
var config = require("../../core/_include/config");
var ResponObj = require("../_include/responObj");
var BuffCon = require("../../core/buff/_con");
var myfs = require("../_include/fs");
var theme = require("./theme");
var role = require("./role");

module.exports = {
	prefix: "/bus/goods_args_map",
	get: {
		"/list": function() {
			var bus = role.getBus(this);
			var query = this.request.query;
			this.body = ResponObj("json", bus.getGoodsArgsMapList(query.num, query.page));
		},
	},
	post: {
		"/add_goods_args_map": function() {
			var bus = role.getBus(this);
			var goods_args_map_info = this.request.body;
			this.body = ResponObj("json", bus.addGoodsArgsMap(goods_args_map_info));
		},
	},
	put: {
		"/update_goods_args_map/:goods_args_map_id": function() {
			var bus = role.getBus(this);
			var goods_args_map_id = this.params.goods_args_map_id;
			var goods_args_map_info = this.request.body.info;
			this.body = ResponObj("json", bus.updateGoodsArgsMap(goods_args_map_id, goods_args_map_info));
		},
	},
	"delete": {
		"/remove_goods_args_map/:goods_args_map_id": function() {
			var bus = role.getBus(this);
			var goods_args_map_id = this.params.goods_args_map_id;
			var body = this.request.body;
			bus.removeGoodsArgsMap(goods_args_map_id);
			this.body = ResponObj("json", bus.getGoodsArgsMapList(body.num, body.page));
		},
	}
}